<template>
    <div class="_public">
        <div class="tag-list">
            <van-tag class="tag" type="default">上月完成数：{{totalObj.last_mon_total}}</van-tag>
            <van-tag class="tag" type="warning">本月完成数：{{totalObj.mon_total}}</van-tag>
            <van-tag class="tag" type="danger">当前返修总数：{{totalObj.back_total}}</van-tag>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            totalObj: {
                last_mon_total: 0,
                mon_total: 0,
                back_total: 0,
            }
        }
    },
    created() {
        this.init()
    },
    methods: {
        init() {
            this.$axios.get('/api/consumer/show').then(res => {
                if(res.status === 200) {
                    let totalObj = {
                        last_mon_total: res.data.data.last_mon_total,
                        mon_total: res.data.data.mon_total,
                        back_total: res.data.data.back_total,
                    }
                    this.totalObj = totalObj
                }
            })
        }
    }
}
</script>

<style lang="less" scoped>
    .tag-list{
        display: flex;
        justify-content: space-around;
        text-align: center;
        height: 60px;
        background-color: #fff;
    }
</style>